<?php
// Loading the table library.
$this->load->library('table');

// Setting the table main heading cols.
$table_heading = array(
	'Date',
	'Amount',
	'User',
	'Particulars',
	'Tag',
	'Edit / Del'
);
$this->table->set_heading($table_heading);
$trans = $trans->result();

foreach ($trans as $key=>$value) {
	$value_arr = (array) $value;
	$exp_id = $value->eid;
	$this->table->add_row(
		$value->date,
		$value->amount,
		$value->display_name,
		$value->description,
		$value->name,
		'<span class="the-icons" data-id="'.$exp_id.'"><i class="icon-pencil"></i>&nbsp;&nbsp;&nbsp;&nbsp;<i class="icon-remove"></i></span>'
	);
}

$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="table table-bordered table-striped table-hover">' );
$this->table->set_template($tmpl);

print $this->table->generate();

// Adding the pagination data compatible with bootstrap.
$this->load->library('pagination');
$config['base_url'] = base_url() . 'transactions/view';
$config['total_rows'] = $rec_count;
$config['per_page'] = 20;
$config['num_links'] = 10;

// Pagination tag container
$config['full_tag_open'] = '<div class="pagination"><ul>';
$config['full_tag_close'] = '</ul></div>';

// Adding li to the numbers in pagination
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';

// Adding li and a tag to the current page tag.
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a></li>';

// Handling the first link and last link
$config['first_tag_open'] = '<li>';
$config['first_tag_close'] = '</li>';
$config['last_tag_open'] = '<li>';
$config['last_tag_close'] = '</li>';

// Handling the next and prev link.
$config['next_link'] = '»';
$config['next_tag_open'] = '<li>';
$config['next_tag_close'] = '</li>';
$config['prev_link'] = '«';
$config['prev_tag_open'] = '<li>';
$config['prev_tag_close'] = '</li>';

$this->pagination->initialize($config);

// Printing the pagination.
print $this->pagination->create_links();
?>

<!-- Modal -->
<div id="edit-modal-popup-container">

</div>